package com.xxx.td;

import java.util.concurrent.locks.LockSupport;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/30 11:35
 * @Copyright 博为峰
 */
public class Wt {
    private static Object obj = new Object();

    public static void main(String[] args) {

        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {//t0  t1  t2
                System.out.println(Thread.currentThread().getName() + "-A");
                LockSupport.park();//阻塞
                System.out.println(Thread.currentThread().getName() + "-B");

            }
        });//Thread-0
        t.start();
        try {
            Thread.sleep(100);//释放cpu执行权，不释放锁
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
//        LockSupport.unpark(t);
        System.out.println(Thread.currentThread().getName() + "-C");
    }
}
